home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games 1996 December / Amiga Games 1996 #12.iso / rexx / ttx / addref.ttx next >
Text File  |  1992-12-29  |  1KB  |  60 lines

  1. /** $VER: AddRef.ttx 1.0 (16.May.91)
  2.  ** Written by David N. Junod
  3.  **
  4.  ** Add the current word to the cross reference table.
  5.  **
  6.  ** Add the following line to your TTX_Startup.dfn file, in the KEYBOARD:
  7.  ** section.
  8.  **
  9.  **   F10  ExecARexxMacro REXX:AddRef.ttx
  10.  **
  11.  **/
  12.  
  13.  
  14. OPTIONS RESULTS
  15. PARSE ARG word file line
  16.  
  17.   /* Make sure AmigaGuide is loaded as a function host */
  18.   IF ~SHOW(L,'amigaguide.library') THEN
  19.      CALL ADDLIB('amigaguide.library',0,-30)
  20.  
  21.   /* Did they pass a word? */
  22.   IF word = "" THEN DO
  23.  
  24.     /* Get the word from under the cursor */
  25.     GetWord
  26.     word = RESULT
  27.  
  28.   END
  29.  
  30.   /* Did they pass the file name */
  31.   IF file = "" THEN DO
  32.  
  33.      /* Get the name of the current document, complete with path */
  34.      GetFilePath
  35.      file = RESULT
  36.  
  37.   END
  38.  
  39.   /* Did they pass the line */
  40.   IF line = "" THEN DO
  41.  
  42.      /* Get the current line position */
  43.      GetCursorPos
  44.      PARSE VAR RESULT line .
  45.  
  46.      /* Adjust the line */
  47.      line = line - 1
  48.  
  49.   END
  50.  
  51.   /* Try adding the link */
  52.   error = AddXRef(word,file,line)
  53.  
  54.   /* Able to add the node? */
  55.   IF error = 0 THEN message = '"*"'||word||'*" already in list"'
  56.                ELSE message = '"Added *"'||word||'*""'
  57.  
  58.   /* Show the message */
  59.   SetStatusBar Temporary message
  60.